package com.dx.wlmq.service.impl;

import com.dx.wlmq.domain.SysUser;
import com.dx.wlmq.mapper.SysUserMapper;
import com.dx.wlmq.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * @ClassName SysUserServiceImpl
 * @Description 业务层实现
 * @Author 12994
 * @Date 2024/10/20 11:33
 * @Version 1.0
 **/
// 提示控制层可以用此注入一个业务层实现
@Service("sysUserService")
public class SysUserServiceImpl implements SysUserService {

    // 提示业务层可以注入一个实现
    // 并且限制是sysUserMapper这个DAO层接口(实现借由Mybatis的xml实现)
    @Autowired
    @Qualifier("sysUserMapper")
    private SysUserMapper sysUserMapper;

    @Override
    public ArrayList<SysUser> listSysUsers() {
        return sysUserMapper.listSysUsers();
    }

    @Override
    public SysUser findUserByUserId(Long userId) {
        return sysUserMapper.findUserByUserId(userId);
    }

    @Override
    public int addSysUser(SysUser sysUser) {
        return sysUserMapper.addSysUser(sysUser);
    }

    @Override
    public int updateSysUser(SysUser sysUser) {
        return sysUserMapper.updateSysUser(sysUser);
    }

    @Override
    public int removeSysUserByUserId(Long userId) {
        return sysUserMapper.removeSysUserByUserId(userId);
    }

    @Override
    public ArrayList<SysUser> listSysUsersLike(String userName) {
        return sysUserMapper.listSysUsersLike(userName);
    }


}
